#include <iostream>
#include <functional>

using TaskFunc = std::function<void()>;
using ReleaseFunc = std::function<void()>;


class TimerTask
{
private:
    uint64_t _id;
    uint32_t _timeout;
    bool _canceled;
    TaskFunc _task_cb;
    ReleaseFunc _release;
public:
    TimerTask(uint64_t id, uint32_t delay, const TaskFunc& cb)
        :_id(id), _timeout(delay), _task_cb(cb), _canceled(false)
    { }

    void Cancel(){ _canceled = true; }
    void SetRelease(const ReleaseFunc& cb){ _release = cb; }

};



